package com.bos.dao.repositories;

import com.bos.domian.system.Role;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author misterWei
 * @create 2018年12月31号:16点07分
 * @mailbox mynameisweiyan@gmail.com
 */
public interface RoleRepository extends JpaRepository<Role,Integer>{
   @Query("from Role as r inner join fetch r.users as u where  u.id=?1")
    List<Role> getByUserRole(Integer userId);
}
